package reflect;

/**
 * Author itcast
 * Date 2021/10/13 10:02
 * Desc TODO
 */
public class Student {
    private String name;
    private int age;
    public String address;

    public Student() {
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    //获取 getter setter方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void eat(String animal,String food){
        System.out.println(animal+"吃"+food);
    }

    public void run(String type,String mile){
        System.out.println(type+" "+mile);
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
